Sweep e2e leftovers from the preview account nightly - #963
Merged
Conversation
The e2e harness shares the preview Cloudflare account and leaks two resource classes: suite runs that crash before their teardown leave an executor-e2e-<hex> worker + D1 + Access app trio behind, and every real Access OTP login by a synthetic ci-…@executor-dev.xyz identity permanently occupies a Zero Trust seat (50 on the free plan). Both recently piled up enough to hit account limits (7 orphaned stacks at the 10-database D1 cap, 29 of 50 seats). preview.ts gains a sweep-e2e subcommand that deletes e2e stacks older than a day (live suite runs are younger; the persistent OTP/emulator/ state-store workers don't match the stack pattern) and revokes seats held by the synthetic e2e domain, and the nightly sweep workflow runs it after the PR-preview pass. Requires the deploy token to carry Access: Users Write (added to the account token).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | a5990b1 | Commit Preview URL Branch Preview URL |
Jun 12 2026, 03:26 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | a5990b1 | Jun 12 2026, 03:26 AM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The e2e harness shares the preview Cloudflare account and leaks two resource classes: suite runs that crash before their teardown leave an
executor-e2e-<hex>worker + D1 + Access app trio behind, and every real Access OTP login by a synthetic e2e identity permanently occupies a Zero Trust seat (50 on the free plan). Both recently piled up enough to hit account limits — 7 orphaned stacks against the 10-database D1 cap, and 29 of 50 seats.preview.tsgains asweep-e2esubcommand:executor-e2e-<8 hex>stacks (worker with?force=true, its D1, its Access app) older than 24h — younger ones may belong to a live suite run, and the persistent fixed-name workers (OTP capture, emulators, state store) don't match the stack pattern.The nightly sweep workflow runs it after the existing PR-preview pass, with the same token/account env. The deploy token needed one extra scope — Access: Users Write — which has been added to the account's scoped token (verified: it can now list users and patch seats).
Verified locally against the (already-clean) account:
{"deletedStacks":[],"revokedSeats":0}— correctly deletes nothing when there's nothing to delete.